<template>
    <!--安防预警详情-->
    <div class="warning_details">
        <div class="content">
            <div class="list_warning">
                <el-scrollbar max-height="320px" height="320px">
                    <div class="ul_box" v-for="(r, idx) in state.warnData" :key="idx">
                        <div class="head">
                            预警信息
                        </div>
                        <ul>
                            <li v-for="(item, index) in r.list" :key="index">
                                <div class="borders" :style="{ background: index ? '#0e96ff' : 'red' }"></div>
                                <span>{{ item.name }}：</span>
                                <span :style="{ color: index ? '#FFF' : 'red' }">{{item.value}}</span>
                            </li>
                            <div class="tip">
                                <p>{{ r.tip }}</p>
                            </div>
                        </ul>

                    </div>
                </el-scrollbar>
            </div>
            <div class="data_fragment">
                    <div>
                        数据片段
                    </div>
                <div>

                </div>
            </div>
        </div>
        <div class="button">
            <el-button class="ignore" @click="hide">忽略</el-button>
            <el-button type="primary" @click="hide">处理</el-button>
        </div>
    </div>
</template>

<script lang="ts" setup>
import {reactive} from 'vue'

const emit = defineEmits(['hiden']);
const state = reactive({
    warnData: [{
        list: [
            {name: '行为分析', value: '吸烟'},
            {name: '触发时间', value: '2022-06-10  10:00:00'},
        ],
        tip: '未处理'
    },]
})
const hide = () => {
    emit('hiden', false);
};
</script>

<style scoped lang="scss">
.warning_details {
    padding: 34px 28px;

    .content {
        display: flex;
        justify-content: space-between;
        flex-grow: 1;

        .list_warning {
            width: 35%;
            margin-right: 25px;

            .ul_box {
                width: 100%;
                margin-bottom: 20px;
                .head {
                    background: rgba(19,79,124,0.5);
                    width: 100%;
                    padding: 12px 0;
                    text-align: center;
                    letter-spacing: 2px;
                    font-size: 18px;
                    color: #FFFFFF;
                }

                ul {
                    background: rgba(27, 54, 77, 0.8);
                    padding: 24px 15px;
                    position: relative;
                    overflow: hidden;
                    li {
                        display: flex;
                        align-items: center;
                        margin-bottom: 18px;
                        .borders {
                            width: 3px;
                            height: 11px;
                            background: #0e96ff;
                            border-radius: 2px;
                            margin-right: 12px;
                        }
                        &:last-of-type {
                            margin-bottom: 0;
                        }
                        span {
                            font-size: 14px;
                            &:first-of-type {
                                @include fontCustomStyle(#b6b5b5, 14px);
                            }
                        }
                    }
                    .tip {
                        color: #294258;
                        background: #fbce05;
                        position: absolute;
                        right: -22px;
                        top: 8px;
                        font-size: 12px;
                        transform: rotateZ(45deg);
                        width: 80px;
                        text-align: center;
                        padding: 1px 0;
                    }
                }
                &:last-child{
                    margin-bottom: 0;
                }
            }
        }
        .data_fragment{
            flex: 1;
            >div{
                width: 100%;
                &:nth-of-type(1){
                    padding-bottom: 16px;
                    border-bottom: 1px dashed #72787D;
                    font-size: 18px;
                    font-weight: 500;
                    color: #1B93FB;
                    margin-bottom: 12px;
                }
                &:nth-of-type(2){
                    width: 100%;
                    height: 260px;
                    background: url("@/assets/image/waringcarback.png") no-repeat;
                    background-size: 100% 100%;
                }
            }
        }
    }
    .button{
        width: 100%;
        display: flex;
        justify-content: center;
    }
    ::v-deep(.ignore) {
        color: #fff;
        background: rgba($color: #fff, $alpha: 0.1);
        border: none;
    }
    ::v-deep(.el-button) {
        padding: 14px 24px;

    }
}
</style>